package com.xjnt.base.support.admin.common.beetl.fn;

import java.util.List;

import org.beetl.core.Context;
import org.beetl.core.Function;

import com.xjnt.base.support.admin.entity.Dictionary;
import com.xjnt.base.support.admin.service.DictionaryService;

public class DictSelFunction implements Function{

	private static final DictionaryService dictService = new DictionaryService();
	
	@Override
	public Object call(Object[] paras, Context ctx) {
		Object o = paras[0];
		if(o != null){
			return findDictionary(o.toString());
		}
		return null;
	}
	
	private List<Dictionary> findDictionary(String code){
		return dictService.findByCode(code);
	}

}
